﻿<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
$typeArr = array(1 => "Catalogue", 2 => "Cars for sale", 3 => "Upcoming auction");
?>
<form action="index.php" method="post" name="adminForm" >
Name 
<input type="text" name="name" id="name" value="<?php echo $this->search['name'];?>" class="text_area"  title="<?php echo JText::_( 'Filter by name' );?>"/>

&nbsp;&nbsp;
<button onclick="this.form.submit();"><?php echo JText::_( 'Search' ); ?></button>
<div id="editcell">
	<table class="adminlist">
	<thead>
		<tr>
			<th width="2%">
				<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->users ); ?>);" />
			</th>
			<th width="2%" align="center">
				<?php echo JText::_( '#' ); ?>
			</th>
			<th width="15%">
				Name
			</th>
			<th width="10%">
				Email
			</th>
			<th width="5%">
				Company
			</th>
			<th width="20%">
				Address
			</th>
			<th width="16%">
				Postnr.
			</th>
			<th width="5%">
				Phone
			</th>
		</tr>			
	</thead>
	<?php
	$k = 0;
	for ($i=0, $n=count( $this->users); $i < $n; $i++)
	{	$row = &$this->users[$i];
		$checked 	 = JHTML::_('grid.id',   $i, $row->id );
		$link 		 = JRoute::_( 'index.php?option=com_ecommerce&controller=users&task=edit&cid[]='. $row->id );
		?>
		<tr class="<?php echo "row$k"; ?>">
			<td>
				<?php echo $checked; ?>
			</td>
			<td align="center">
				<?php echo $this->page->getRowOffset( $i ); ?>
			</td>
			<td align="center">
				<a href="<?php echo $link; ?>"><?php echo $row->name; ?></a>
			</td>		
			<td align="center">
				<?php echo $row->email; ?>
			</td>
			<td align="center">
				<?php echo $row->company; ?>
			</td>
			<td align="center">
				<?php echo $row->address; ?>
			</td>
			<td align="center">
				<?php echo $row->code;?>
			</td>
			<td align="center">
				<?php echo $row->phone; ?>
			</td>			
		</tr>
		<?php
		$k = 1 - $k;
	}
	?>
			<tr>
				<td colspan="8">
					<?php echo $this->page->getListFooter(); ?>
				</td>
			</tr>
	</table>
</div>

<input type="hidden" name="option" value="com_ecommerce" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="controller" value="users" />
</form>
